import type { AddressItem } from "@/types/address"
import { defineStore } from "pinia"
import { ref } from "vue"

export const useMemberAddress = defineStore('address', () => {
  // 当前用户选择的地址
  const address = ref<AddressItem>()

  // 设置地址
  const setAddress = (val: AddressItem) => {
    address.value = val
  }

  // 返回的对象，对外使用
  return {
    address,
    setAddress
  }
})
